feat: add Requesty as an OpenAI-compatible LLM provider#83
Open
Thibaultjaigu wants to merge 1 commit into
Open
feat: add Requesty as an OpenAI-compatible LLM provider#83Thibaultjaigu wants to merge 1 commit into
Thibaultjaigu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Requesty as an OpenAI-compatible LLM provider, mirroring the existing OpenRouter provider as closely as possible.
Requesty (https://requesty.ai) is an OpenAI-compatible LLM gateway. It exposes the standard
/v1/chat/completionsendpoint, usesAuthorization: Bearer <key>auth, andprovider/modelnaming (e.g.openai/gpt-4o-mini), so it slots into the existing OpenAI-compatible provider plumbing with no special-casing.https://router.requesty.ai/v1https://router.requesty.ai/v1/chat/completionsWiring sites (each mirrors the OpenRouter entry exactly)
Frontend (
frontend/magic-web):packages/magic-admin/src/const/aiModel.ts— addedRequestyto theServiceProviderenum andhttps://router.requesty.ai/v1/chat/completionsto theServiceProviderUrlbase-URL map.packages/magic-admin/src/pages/PlatformPackage/components/ServiceIcon/index.tsx— addedRequestyto the service-icon map (reuses the existing default icon; no new binary asset).src/pages/superMagic/.../AddModel/providerFieldConfigs.ts— addedrequestyto the provider-code map, the URL-placeholder override map (https://router.requesty.ai/v1), and the API-key-placeholder map.src/pages/initialization/components/Step2Provider.tsx— added theRequestyprovider config (defaultUrl: https://router.requesty.ai/v1) and the dropdown entry.src/assets/locales/en_US/initialization.jsonandzh_CN/initialization.json— added theRequestylabel.Backend (
backend/magic-service):app/Domain/Provider/Entity/ValueObject/ProviderCode.php— added theRequestyenum case. It falls through the existingdefaultarms (implementation →OpenAIModel, sort order → 999), i.e. it is handled as a generic OpenAI-compatible provider, exactly like the non-special-cased providers. No new backend class is required since Requesty is OpenAI-compatible passthrough.Intentionally not touched (would be heavier / provider-specific and out of scope for a generic OpenAI-compatible LLM provider): the image-generation factory/model classes and the DB-seed
ServiceProviderInitializer+ related migration. Happy to add those too if desired.Verification
tsc --noEmit -p tsconfig.app.jsoninfrontend/magic-web/packages/magic-admin. The added enum member, base-URL map entry, icon-map entry, and all mirrored map/config entries compile with zero new errors (verified by diffing the typecheck output against the unmodified baseline — the remaining errors pre-exist in unrelated files and are unaffected by this change).https://router.requesty.ai/v1/chat/completionswith modelopenai/gpt-4o-minireturned HTTP 200 with a valid completion (gpt-4o-mini-2024-07-18), confirming the base URL,provider/modelnaming, and Bearer auth are correct.Links
I work at Requesty. This mirrors the existing OpenRouter provider as closely as possible. Happy to adjust or close it if it's not a fit.